package com.naiterui.ehp.bp.bo.patient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

import java.beans.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 患者基础信息BO
 *
 * @since 2.24
 */
@ToString
@ApiModel(value = "PatientBO", description = "患者基础信息BO")
public class PatientBO implements Serializable {
    /*
     * 患者性别 0：女，1：男，2：未知
     */
    /**
     * 女：<code>GENDER_FEMALE</code>
     */
    public static final int GENDER_FEMALE = 0;
    /**
     * 男：<code>GENDER_MALE</code>
     */
    public static final int GENDER_MALE = 1;
    /**
     * 未知：<code>GENDER_UNKNOWN</code>
     */
    public static final int GENDER_UNKNOWN = 2;

    /**
     * 患者认证状态：已认证
     */
    public static final Integer PATIENT_CERTIFICATION_Y = 1;
    /**
     * 患者认证状态：未认证
     */
    public static final Integer PATIENT_CERTIFICATION_N = 0;

    /**
     * 字段或域定义：<code>serialVersionUID</code>
     */
    private static final long serialVersionUID = -1873518274697904586L;

    /**
     * 唯一标识
     */
    @ApiModelProperty(value = "唯一标识")
    private Long patientId;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    private String name;

    /**
     * 微信openId
     */
    @ApiModelProperty(value = "微信openId")
    private String openId;

    /**
     * 微信unionId
     */
    @ApiModelProperty(value = "微信unionId")
    private String unionId;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private Integer gender;
    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    private String age;

    /**
     * 城市id(默认选中的)
     */
    @ApiModelProperty(value = "城市id(默认选中的)")
    private Integer cityId;

    /**
     * 省份ID
     */
    @ApiModelProperty(value = "省份ID")
    private Integer provinceId;
    /**
     * 城市ID
     */
    @ApiModelProperty(value = "城市ID")
    private Integer cityTempId;
    /**
     * 县ID
     */
    @ApiModelProperty(value = "县ID")
    private Integer countyId;
    /**
     * 省份名称
     */
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    /**
     * 城市名称
     */
    @ApiModelProperty(value = "城市名称")
    private String cityTempName;
    /**
     * 县名称
     */
    @ApiModelProperty(value = "县名称")
    private String countyName;
    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    private String phone;
    /**
     * 身高
     */
    @ApiModelProperty(value = "身高")
    private Integer height;
    /**
     * 体重
     */
    @ApiModelProperty(value = "体重")
    private Integer weight;
    /**
     * 患者认证状态
     */
    @ApiModelProperty(value = "患者认证状态")
    private Integer status;
    /**
     * 婚姻状态
     */
    @ApiModelProperty(value = "婚姻状态")
    private Boolean maritalStatus;

    /**
     * 注册时间
     */
    @ApiModelProperty(value = "注册时间")
    private Date createAt;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    private String nickName;

    /**
     * 是否老用户
     */
    @ApiModelProperty(value = "是否老用户")
    private Boolean old;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String photo;

    /**
     * 密钥（命名选择是为了区分b2c接口密钥sign）
     */
    @ApiModelProperty(value = "密钥（命名选择是为了区分b2c接口密钥sign）")
    private String unionKey = "Serwkfjrewkjvlwe3483ddf";

    /**
     * 城市名
     */
    @ApiModelProperty(value = "城市名")
    private String city;

    /**
     * 是否可以咨询。完善基本资料后才可咨询
     */
    @ApiModelProperty(value = "是否可以咨询。完善基本资料后才可咨询")
    private Boolean canTalk;

    /**
     * 私人医生数量
     */
    @ApiModelProperty(value = "私人医生数量")
    private String personalNum;

    /**
     * 唯一私人医生id
     */
    @ApiModelProperty(value = "唯一私人医生id")
    @JsonInclude(Include.NON_NULL)
    private String defautDr;

    /**
     * <是否有私人医生>
     */
    @ApiModelProperty(value = "是否有私人医生")
    private Boolean havePersonal;

    /**
     * <患者所属科室－－推广医生所在科室>
     */
    @ApiModelProperty(value = "患者所属科室－－推广医生所在科室")
    private String department;

    /**
     * 首次绑定手机号 true：是；false：否 不用于json转换，业务判断使用：<code>firstBind</code>
     */
    @JsonIgnore
    private Boolean firstBind;

    /**
     * 患者app使用
     */
    @ApiModelProperty(value = "患者app使用")
    private String token;

    /**
     * 图文咨询收费(单位分)
     */
    @ApiModelProperty(value = "图文咨询收费(单位分)")
    private Integer consultCost;

    /**
     * 是否收费1收费，0免费
     */
    @ApiModelProperty(value = "是否收费1收费，0免费")
    private Integer consultPayType;
    /**
     * 身份证号：<code>idNo</code>
     */
    @ApiModelProperty(value = "身份证号")
    private String idNo;
    /**
     * 出生日期：<code>birthday</code>
     */
    @ApiModelProperty(value = "出生日期[PT-2.14.0新增]")
    private Long birthday;

    @ApiModelProperty("用户Id")
    private String miniOpenId;

    public String getMiniOpenId() {
        return miniOpenId;
    }

    public void setMiniOpenId(String miniOpenId) {
        this.miniOpenId = miniOpenId;
    }

    public Boolean getFirstBind() {
        return firstBind;
    }

    public void setFirstBind(Boolean firstBind) {
        this.firstBind = firstBind;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public Boolean getHavePersonal() {
        return havePersonal;
    }

    public void setHavePersonal(Boolean havePersonal) {
        this.havePersonal = havePersonal;
    }

    public String getDefautDr() {
        return defautDr;
    }

    public void setDefautDr(String defautDr) {
        this.defautDr = defautDr;
    }

    public String getPersonalNum() {
        return personalNum;
    }

    public void setPersonalNum(String personalNum) {
        this.personalNum = personalNum;
    }

    public Boolean getCanTalk() {
        return canTalk;
    }

    public void setCanTalk(Boolean canTalk) {
        this.canTalk = canTalk;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Long getPatientId() {
        return patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (StringUtils.isEmpty(name)) {
            name = "互联网医院患者";
        }
        this.name = name;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public Boolean getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(Boolean maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public String getUnionKey() {
        return unionKey;
    }

    public void setUnionKey(String unionKey) {
        this.unionKey = unionKey;
    }

    public Boolean getOld() {
        return old;
    }

    public void setOld(Boolean old) {
        this.old = old;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Integer getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }

    public Integer getCountyId() {
        return countyId;
    }

    public void setCountyId(Integer countyId) {
        this.countyId = countyId;
    }

    public Integer getCityTempId() {
        return cityTempId;
    }

    public void setCityTempId(Integer cityTempId) {
        this.cityTempId = cityTempId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityTempName() {
        return cityTempName;
    }

    public void setCityTempName(String cityTempName) {
        this.cityTempName = cityTempName;
    }

    public String getCountyName() {
        return countyName;
    }

    public void setCountyName(String countyName) {
        this.countyName = countyName;
    }

    public Integer getConsultCost() {
        return consultCost;
    }

    public void setConsultCost(Integer consultCost) {
        this.consultCost = consultCost;
    }

    public Integer getConsultPayType() {
        return consultPayType;
    }

    public void setConsultPayType(Integer consultPayType) {
        this.consultPayType = consultPayType;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public Long getBirthday() {
        return birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取患者性别
     * Patient.getGenderStr()
     *
     * @return
     *
     * @Date 2016年6月21日
     * @since 2.5.0
     */
    @Transient
    public String getGenderStr() {
        if (null == gender) {
            return "未知";
        }
        String genderStr;
        switch (gender) {
            case GENDER_FEMALE:
                genderStr = "女";
                break;
            case GENDER_MALE:
                genderStr = "男";
                break;
            case GENDER_UNKNOWN:
                genderStr = "未知";
                break;
            default:
                genderStr = "未知";
                break;
        }
        return genderStr;
    }

}
